<template>
    <div>
            <Card>
                <p slot="title">
				    企业认证审核
			    </p>
                <div>
                    <Form class="step-form" ref="userData" :model="userData" :rules="userDataRules"  :label-width="100">
                       <Row span="12">
                            <i-col span="12" >
                                <FormItem label="企业名称：" label-position="left" :label-width="150">
                                    <Input  :disabled="true" v-model="userData.name" type="text" placeholder="输入数据不能为空" />
                                </FormItem>
                            </i-col>
                        </Row>
                        <Row span="12">
                            <i-col span="12" >
                                <FormItem label="企业简介：" prop="partyInfo" label-position="left" :label-width="150">
                                    <Input :disabled="hasSubmit" v-model="userData.partyInfo" :rows="4" type="textarea" placeholder="输入数据不能为空" />
                                </FormItem>
                            </i-col>
                        </Row>          
                        <Row span="12">
                            <i-col span="12" >
                                <FormItem label="准入金额：" prop="amountMoney" label-position="left" :label-width="150">
                                    <Input :disabled="hasSubmit" v-model="userData.amountMoney" type="text" placeholder="输入准入金额（单位:万元）" />
                                </FormItem>
                            </i-col>
                        </Row>          
                         <Row span="12">
                            <i-col span="10">
                                <FormItem label="营业执照图片：" label-position="left" :label-width="150">
                                    <img v-if="userData.businessLicenseUrl !== ''" :src="userData.businessLicenseUrl" height="100%" width="100%">
                                </FormItem>
                            </i-col>
                        </Row>
                        <Row span="12">
                            <i-col span="10">
                                <FormItem label="身份证正面："  label-position="left" :label-width="150">
                                    <img v-if="userData.cardUrl !== ''" :src="userData.cardUrl" height="100%" width="100%">
                                </FormItem>
                            </i-col>
                            <i-col span="10">
                                <FormItem label="身份证反面：" prop="cardBackUrl" label-position="left" :label-width="150">
                                    <img v-if="userData.cardBackUrl !== ''" :src="userData.cardBackUrl" height="100%" width="100%">
                                </FormItem>
                            </i-col>
                        </Row>
                       <Row span="12">
                            <i-col span="3">
                                <FormItem label="开户许可证：" prop="img_url" label-position="left" :label-width="150">
                                </FormItem>
                            </i-col>
                            <i-col span="20">
                                <template>
                                    <div class="demo-upload-list" v-for="item in uploadList">
                                        <img :src="item.imgUrl">
                                        <div class="demo-upload-list-cover">
                                            <Icon type="ios-eye-outline" @click.native="handleView(item.imgUrl)"></Icon>
                                            <Icon type="ios-trash-outline" @click.native="handleRemove(item,1)"></Icon>
                                        </div>
                                       
                                    </div>
                                    <Upload
                                        ref="upload"
                                        :show-upload-list="false"
                                        :format="['jpg','jpeg','png']"
                                        :max-size="2048"
                                        :on-format-error="handleFormatError"
                                        :on-exceeded-size="handleMaxSize"
                                        :before-upload="handleBeforeUpload"
                                        type="drag"
                                        action="//jsonplaceholder.typicode.com/posts/"
                                        style="display: inline-block;width:58px;">
                                        <div style="width: 58px;height:58px;line-height: 58px;">
                                            <Icon type="camera" size="20"></Icon>
                                        </div>
                                    </Upload>
                                    <Modal title="查看图片" v-model="visible">
                                        <img :src="imgViewUrl" v-if="visible" style="width: 100%">
                                    </Modal>
                                </template>
                            </i-col>
                        </Row>
                        <Row span="12">
                            <i-col span="3">
                                <FormItem label="企业征信报告：" label-position="left" :label-width="150">
                                </FormItem>
                            </i-col>
                            <i-col span="20">
                                <template>
                                    <div class="demo-upload-list" v-for="item in creditUploadList">
                                        <img :src="item.imgUrl">
                                        <div class="demo-upload-list-cover">
                                            <Icon type="ios-eye-outline" @click.native="handleView(item.imgUrl)"></Icon>
                                            <Icon type="ios-trash-outline" @click.native="handleRemove(item,2)"></Icon>
                                        </div>
                                    </div>
                                    <Upload
                                        ref="upload"
                                        :show-upload-list="false"
                                        :format="['jpg','jpeg','png']"
                                        :max-size="2048"
                                        :on-format-error="handleFormatError"
                                        :on-exceeded-size="handleMaxSize"
                                        :before-upload="creditHandleBeforeUpload"
                                        multiple
                                        type="drag"
                                        action="//jsonplaceholder.typicode.com/posts/"
                                        style="display: inline-block;width:58px;">
                                        <div style="width: 58px;height:58px;line-height: 58px;">
                                            <Icon type="camera" size="20"></Icon>
                                        </div>
                                    </Upload>
                                    <Modal title="查看图片" v-model="visible">
                                        <img :src="imgViewUrl" v-if="visible" style="width: 100%">
                                    </Modal>
                                </template>
                            </i-col>
                        </Row>
                        <Row span="12">
                            <i-col span="3">
                                <FormItem label="地址权属证明：" label-position="left" :label-width="150">
                                </FormItem>
                            </i-col>
                            <i-col span="20">
                                <template>
                                    <div class="demo-upload-list" v-for="item in addressUploadList">
                                        <img :src="item.imgUrl">
                                        <div class="demo-upload-list-cover">
                                            <Icon type="ios-eye-outline" @click.native="handleView(item.imgUrl)"></Icon>
                                            <Icon type="ios-trash-outline" @click.native="handleRemove(item,3)"></Icon>
                                        </div>
                                    </div>
                                    <Upload
                                        ref="upload"
                                        :show-upload-list="false"
                                        :format="['jpg','jpeg','png']"
                                        :max-size="2048"
                                        :on-format-error="handleFormatError"
                                        :on-exceeded-size="handleMaxSize"
                                        :before-upload="addressHandleBeforeUpload"
                                        multiple
                                        type="drag"
                                        action="//jsonplaceholder.typicode.com/posts/"
                                        style="display: inline-block;width:58px;">
                                        <div style="width: 58px;height:58px;line-height: 58px;">
                                            <Icon type="camera" size="20"></Icon>
                                        </div>
                                    </Upload>
                                    <Modal title="查看图片" v-model="visible">
                                        <img :src="imgViewUrl" v-if="visible" style="width: 100%">
                                    </Modal>
                                </template>
                            </i-col>
                        </Row>
                        <Row span="12">
                            <i-col span="3">
                                <FormItem label="个人征信报告：" label-position="left" :label-width="150">
                                </FormItem>
                            </i-col>
                            <i-col span="20">
                                <template>
                                    <div class="demo-upload-list" v-for="item in personalUploadList">
                                        <img :src="item.imgUrl">
                                        <div class="demo-upload-list-cover">
                                            <Icon type="ios-eye-outline" @click.native="handleView(item.imgUrl)"></Icon>
                                            <Icon type="ios-trash-outline" @click.native="handleRemove(item,4)"></Icon>
                                        </div>
                                    </div>
                                    <Upload
                                        ref="upload"
                                        :show-upload-list="false"
                                        :format="['jpg','jpeg','png']"
                                        :max-size="2048"
                                        :on-format-error="handleFormatError"
                                        :on-exceeded-size="handleMaxSize"
                                        :before-upload="personalHandleBeforeUpload"
                                        multiple
                                        type="drag"
                                        action="//jsonplaceholder.typicode.com/posts/"
                                        style="display: inline-block;width:58px;">
                                        <div style="width: 58px;height:58px;line-height: 58px;">
                                            <Icon type="camera" size="20"></Icon>
                                        </div>
                                    </Upload>
                                    <Modal title="查看图片" v-model="visible">
                                        <img :src="imgViewUrl" v-if="visible" style="width: 100%">
                                    </Modal>
                                </template>
                            </i-col>
                        </Row>

                        <Row span="12">
                            <i-col span="3">
                                <FormItem label="财务报表：" label-position="left" :label-width="150">
                                </FormItem>
                            </i-col>
                            <i-col span="20">
                                <template>
                                    <div class="demo-upload-list" v-for="item in financeUploadList">
                                        <img :src="item.imgUrl">
                                        <div class="demo-upload-list-cover">
                                            <Icon type="ios-eye-outline" @click.native="handleView(item.imgUrl)"></Icon>
                                            <Icon type="ios-trash-outline" @click.native="handleRemove(item,5)"></Icon>
                                        </div>
                                    </div>
                                    <Upload
                                        ref="upload"
                                        :show-upload-list="false"
                                        :format="['jpg','jpeg','png']"
                                        :max-size="2048"
                                        :on-format-error="handleFormatError"
                                        :on-exceeded-size="handleMaxSize"
                                        :before-upload="financeHandleBeforeUpload"
                                        multiple
                                        type="drag"
                                        action="//jsonplaceholder.typicode.com/posts/"
                                        style="display: inline-block;width:58px;">
                                        <div style="width: 58px;height:58px;line-height: 58px;">
                                            <Icon type="camera" size="20"></Icon>
                                        </div>
                                    </Upload>
                                    <Modal title="查看图片" v-model="visible">
                                        <img :src="imgViewUrl" v-if="visible" style="width: 100%">
                                    </Modal>
                                </template>
                            </i-col>
                        </Row>
                        <Row span="12">
                            <i-col span="3">
                                <FormItem label="财务流水：" label-position="left" :label-width="150">
                                </FormItem>
                            </i-col>
                            <i-col span="20">
                                <template>
                                    <div class="demo-upload-list" v-for="item in flowUploadList">
                                        <img :src="item.imgUrl">
                                        <div class="demo-upload-list-cover">
                                            <Icon type="ios-eye-outline" @click.native="handleView(item.imgUrl)"></Icon>
                                            <Icon type="ios-trash-outline" @click.native="handleRemove(item,6)"></Icon>
                                        </div>
                                    </div>
                                    <Upload
                                        ref="upload"
                                        :show-upload-list="false"
                                        :format="['jpg','jpeg','png']"
                                        :max-size="2048"
                                        :on-format-error="handleFormatError"
                                        :on-exceeded-size="handleMaxSize"
                                        :before-upload="flowHandleBeforeUpload"
                                        multiple
                                        type="drag"
                                        action="//jsonplaceholder.typicode.com/posts/"
                                        style="display: inline-block;width:58px;">
                                        <div style="width: 58px;height:58px;line-height: 58px;">
                                            <Icon type="camera" size="20"></Icon>
                                        </div>
                                    </Upload>
                                    <Modal title="查看图片" v-model="visible">
                                        <img :src="imgViewUrl" v-if="visible" style="width: 100%">
                                    </Modal>
                                </template>
                            </i-col>
                        </Row>
                        <Row span="12">
                            <i-col span="3">
                                <FormItem label="办公场地图片：" label-position="left" :label-width="150">
                                </FormItem>
                            </i-col>
                            <i-col span="20">
                                <template>
                                    <div class="demo-upload-list" v-for="item in spaceUploadList">
                                        <img :src="item.imgUrl">
                                        <div class="demo-upload-list-cover">
                                            <Icon type="ios-eye-outline" @click.native="handleView(item.imgUrl)"></Icon>
                                            <Icon type="ios-trash-outline" @click.native="handleRemove(item,7)"></Icon>
                                        </div>
                                    </div>
                                    <Upload
                                        ref="upload"
                                        :show-upload-list="false"
                                        :format="['jpg','jpeg','png']"
                                        :max-size="2048"
                                        :on-format-error="handleFormatError"
                                        :on-exceeded-size="handleMaxSize"
                                        :before-upload="spaceHandleBeforeUpload"
                                        multiple
                                        type="drag"
                                        action="//jsonplaceholder.typicode.com/posts/"
                                        style="display: inline-block;width:58px;">
                                        <div style="width: 58px;height:58px;line-height: 58px;">
                                            <Icon type="camera" size="20"></Icon>
                                        </div>
                                    </Upload>
                                    <Modal title="查看图片" v-model="visible">
                                        <img :src="imgViewUrl" v-if="visible" style="width: 100%">
                                    </Modal>
                                </template>
                            </i-col>
                        </Row>
                        
                        <FormItem style='margin-top:80px;'>
                            <Button @click="saveData" style="width:100px;" type="primary">确定</Button>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <Button @click="goBack" style="width:100px;" >返回</Button>
                        </FormItem>
                    </Form>
                </div>
            </Card>
            
    </div>
</template>


<script>
import ajax from '../../../libs/axios.js'
export default {
    name: 'addUser',
    data () {
        return {
            modal1:false,
            testModelShow:false,
            symptomList:[],
            selectModel:[],
            uploadList: [],//开户许可证上传图片存储
            creditUploadList: [],//企业征信报告上传图片存储
            addressUploadList:[],//经营地址所属权证明
            personalUploadList:[],//个人征信报告图片存储
            financeUploadList:[],//财务报表图片存储
            flowUploadList:[],//财务流水
            spaceUploadList:[],//办公场地图片
            defaultList: [],
            imgViewUrl:'',
            visible: false,
            isupload:true,//判断是否可以正常上传图片
            img_url: '',
            partyId:'',//企业Id
            userData: {
                id:'',
                name:'',
                partyInfo:'',
                businessLicenseUrl:'',
                cardUrl:'',
                cardBackUrl:''
            },
            isAdd:'-1',//新增、修改的标识
            hasSubmit: false,
            status: 'wait',
            uploadLoading: false, // 上传图片时候的加载效果,
            failreason:"",//审核失败
            userId:-1,//当前登陆人员的Id
            userName:"",//当前登陆人员的姓名
            id:-1,
            userDataRules: {
                partyInfo: [
                    { required: true, message: '企业简介不能为空', trigger: 'blur'},
                    {type: 'string', max: 150, message: '不能超过150个字符', trigger: 'blur'}
                ],
                amountMoney: [
                   { required: true, message: '金额不能为空', trigger: 'blur'},
                ]
            },
        }
    },
    methods: {
        // 数据初始化
        init () {
            this.userId = window.localStorage.getItem('userId')
            this.userName = window.localStorage.getItem('userName')
            this.$store.commit('setActiveName', 'bankinginfoindex');
            this.partyId = this.$route.params.id;
            var id = this.$route.params.id;
            this.partyInfo(id);
        },
        handleView (url) {
                this.imgViewUrl = url;
                this.visible = true;
            },
            handleRemove (f,pictureType) {
                let _that = this;
                if(pictureType === 1){
                    _that.uploadList.splice(_that.uploadList.indexOf(f),1);
                } else if(pictureType === 2){
                    _that.creditUploadList.splice(_that.creditUploadList.indexOf(f),1);
                }else if(pictureType === 3){
                    _that.addressUploadList.splice(_that.addressUploadList.indexOf(f),1);
                }else if(pictureType === 4){//个人征信报告
                    _that.personalUploadList.splice(_that.personalUploadList.indexOf(f),1);
                }else if(pictureType === 5){//财务报表
                    _that.financeUploadList.splice(_that.financeUploadList.indexOf(f),1);
                }else if(pictureType === 6){//财务流水
                    _that.flowUploadList.splice(_that.flowUploadList.indexOf(f),1);
                }else if(pictureType === 7){//财务流水
                    _that.spaceUploadList.splice(_that.spaceUploadList.indexOf(f),1);
                }
            },
            handleSuccess (res, file) {
                // 因为上传过程为实例，这里模拟添加 url
                file.url = this.imgUrl;
                file.name = this.imgName;
                
            },
            handleFormatError (file) {
                this.$Notice.warning({
                    title: '文件格式不正确',
                    desc: '文件 ' + file.name + ' 格式不正确，请上传 jpg 或 png 格式的图片。'
                });
                //设置图片是否可以正常上传
                this.isupload = false;
            },
            handleMaxSize (file) {
                this.$Notice.warning({
                    title: '超出文件大小限制',
                    desc: '文件 ' + file.name + ' 太大，不能超过 2M。'
                });
                this.isupload = false;
            },
            handleBeforeUpload (file) {
                const check = this.uploadList.length < 9;
                if (!check) {
                    this.$Notice.warning({
                        title: '最多只能上传 9 张图片。'
                    });
                }else{
                    if(this.isupload){
                        this.uploadType = 1
                        this.file = file
                        this.upload()
                    }
                }
                return check;
            },
        creditHandleBeforeUpload (file) {
            const check = this.creditUploadList.length < 9;
            if (!check) {
                this.$Notice.warning({
                    title: '最多只能上传 9 张图片。'
                });
            }else{
                if(this.isupload){
                    this.uploadType = 2
                    this.file = file
                    this.upload()
                }   
            }
            return check;
        },
        addressHandleBeforeUpload (file) {
            const check = this.addressUploadList.length < 9;
            if (!check) {
                this.$Notice.warning({
                    title: '最多只能上传 9 张图片。'
                });
            }else{
                if(this.isupload){
                    this.uploadType = 3
                    this.file = file
                    this.upload()
                }   
            }
            return check;
        },
        //个人征信报告
        personalHandleBeforeUpload (file) {
            const check = this.personalUploadList.length < 9;
            if (!check) {
                this.$Notice.warning({
                    title: '最多只能上传 9 张图片。'
                });
            }else{
                if(this.isupload){
                    this.uploadType = 4
                    this.file = file
                    this.upload()
                }   
            }
            return check;
        },
        financeHandleBeforeUpload (file) {//财务报表图片
            const check = this.financeUploadList.length < 9;
            if (!check) {
                this.$Notice.warning({
                    title: '最多只能上传 9 张图片。'
                });
            }else{
                if(this.isupload){
                    this.uploadType = 5
                    this.file = file
                    this.upload()
                }   
            }
            return check;
        },
        flowHandleBeforeUpload (file) {//财务流水
            const check = this.flowUploadList.length < 9;
            if (!check) {
                this.$Notice.warning({
                    title: '最多只能上传 9 张图片。'
                });
            }else{
                if(this.isupload){
                    this.uploadType = 6
                    this.file = file
                    this.upload()
                }   
            }
            return check;
        },
        spaceHandleBeforeUpload (file) {//办公场地照片
            const check = this.spaceUploadList.length < 9;
            if (!check) {
                this.$Notice.warning({
                    title: '最多只能上传 9 张图片。'
                });
            }else{
                if(this.isupload){
                    this.uploadType = 7
                    this.file = file
                    this.upload()
                }   
            }
            return check;
        },
        partyInfo(id) {
            var _that = this;
            var url = 'adminlogin/banking/selectData';
            var data = {
                id: id
            };
            ajax.formRes(url, data).then(function (res) {
                if (200 == res.code) {
                    _that.userData = res.data;
                    _that.isAdd = res.data.isAdd;
                    res.data.pictures.forEach(function (c) {
                        console.log(c.pictureType);
                        let f = {};
                        if(c.pictureType === 1){
                            f.imgUrl = c.picturePath
                            _that.uploadList.push(f);
                        } else if(c.pictureType === 2){
                            f.imgUrl = c.picturePath
                            _that.creditUploadList.push(f);
                        }else if(c.pictureType === 3){
                            f.imgUrl = c.picturePath
                            _that.addressUploadList.push(f);
                        }else if(c.pictureType === 4){//个人征信报告
                            f.imgUrl = c.picturePath
                            _that.personalUploadList.push(f);
                        }else if(c.pictureType === 5){//财务报表
                            f.imgUrl = c.picturePath
                            _that.financeUploadList.push(f);
                        }else if(c.pictureType === 6){//财务流水
                            f.imgUrl = c.picturePath
                            _that.flowUploadList.push(f);
                        }else if(c.pictureType === 7){//财务流水
                            f.imgUrl = c.picturePath
                            _that.spaceUploadList.push(f);
                        }
                    })
                } else {
                    _that.$Message.success('数据原因，请联系管理员。');
                }
            }).catch(function (res) {
                console.log('有错误信息');
            });
        },
        // 上传图片
        upload () {
            let that = this
            let fileName = that.file.name
            //FormData 对象
            let formData = new FormData()
            console.log(fileName)
            this.uploadLoading = true
            // 文件对象
            formData.append("img", that.file)
            formData.append("type", that.partyId)
            ajax.upload('adminlogin/file/uploadOssImage',formData).then(function (res) {
                let f = {};
                if(that.uploadType === 1){
                    f.imgUrl = res.url
                    that.uploadList.push(f);
                } else if(that.uploadType === 2){
                    f.imgUrl = res.url
                    that.creditUploadList.push(f);
                }else if(that.uploadType === 3){
                    f.imgUrl = res.url
                    that.addressUploadList.push(f);
                }else if(that.uploadType === 4){//个人征信报告
                    f.imgUrl = res.url
                    that.personalUploadList.push(f);
                }else if(that.uploadType === 5){//财务报表
                    f.imgUrl = res.url
                    that.financeUploadList.push(f);
                }else if(that.uploadType === 6){//财务流水
                    f.imgUrl = res.url
                    that.flowUploadList.push(f);
                }else if(that.uploadType === 7){//财务流水
                    f.imgUrl = res.url
                    debugger;
                    that.spaceUploadList.push(f);
                }
                
                that.$Message.success('上传成功')              
            }, function (err) {
                console.log(err)
            }).catch(function (error) {
                console.log(error)
            })
        },
        // 添加数据
        saveData () {

            let that = this
            //开户许可证上传图片存储
            let uploadStr = '';
            that.uploadList.forEach(function (c) {uploadStr = c.imgUrl +","+uploadStr})
            uploadStr = that.uploadList.length >0?uploadStr.substring(0,uploadStr.length-1):"";
            //企业征信报告上传图片存储
            let creditStr = '';
            that.creditUploadList.forEach(function (c) {creditStr = c.imgUrl +","+creditStr})
            creditStr = that.creditUploadList.length >0?creditStr.substring(0,creditStr.length-1):"";
            //经营地址所属权证明
            let addressStr = '';
            
            addressStr = that.addressUploadList.length >0?addressStr.substring(0,addressStr.length-1):"";
            //个人征信报告图片存储
            let personalStr = '';
            that.personalUploadList.forEach(function (c) {personalStr = c.imgUrl +","+personalStr})
            personalStr = that.personalUploadList.length >0?personalStr.substring(0,personalStr.length-1):"";
            //财务报表图片存储
            let financeStr = '';
            that.financeUploadList.forEach(function (c) {financeStr = c.imgUrl +","+financeStr})
            financeStr = that.financeUploadList.length >0?financeStr.substring(0,financeStr.length-1):"";
            //财务流水
            let flowStr = '';
            that.flowUploadList.forEach(function (c) {flowStr = c.imgUrl +","+flowStr})
            flowStr = that.flowUploadList.length >0?flowStr.substring(0,flowStr.length-1):"";
            //办公场地图片
            let spaceStr = '';
            that.spaceUploadList.forEach(function (c) {spaceStr = c.imgUrl +","+spaceStr})
            spaceStr = that.spaceUploadList.length >0?spaceStr.substring(0,spaceStr.length-1):"";
            if(that.isAdd === 1){
                that.$refs['userData'].validate((valid) => {
                    if (valid) {
                        that.hasSubmit = true
                        let url = 'adminlogin/banking/addInfo'
                        let data = {
                            partyInfo:that.userData.partyInfo,
                            amountMoney:that.userData.amountMoney,
                            createType:2,
                            createUser:that.userId,
                            partyId:that.partyId,
                            uploadStr:uploadStr,
                            creditStr:creditStr,
                            addressStr:addressStr,
                            personalStr:personalStr,
                            financeStr:financeStr,
                            flowStr:flowStr,
                            spaceStr:spaceStr
                        }
                        ajax.formRes(url, data).then(res => {
                            // success
                            that.$Message.success('新增数据成功,页面正在跳转')
                            that.hasSubmit = false
                                let argu = {
                                }
                                that.$router.push({
                                    name: 'bankinginfoindex',
                                    params: argu
                                })
                        }).catch(res => {
                            console.log('有错误信息')
                            // fail
                        })
                    } else {
                        console.log('新增失败。。。')
                    }
                })
            }else{
                that.$refs['userData'].validate((valid) => {
                    if (valid) {
                        that.hasSubmit = true
                        let url = 'adminlogin/banking/updateInfo'
                        let data = {
                            bankingId:that.userData.bankingId,
                            partyInfo:that.userData.partyInfo,
                            amountMoney:that.userData.amountMoney,
                            createType:2,
                            createUser:that.userId,
                            partyId:that.partyId,
                            uploadStr:uploadStr,
                            creditStr:creditStr,
                            addressStr:addressStr,
                            personalStr:personalStr,
                            financeStr:financeStr,
                            flowStr:flowStr,
                            spaceStr:spaceStr
                        }
                        ajax.formRes(url, data).then(res => {
                            // success
                            that.$Message.success('新增数据成功,页面正在跳转')
                            that.hasSubmit = false
                                let argu = {
                                }
                                that.$router.push({
                                    name: 'bankinginfoindex',
                                    params: argu
                                })
                        }).catch(res => {
                            console.log('有错误信息')
                            // fail
                        })
                    } else {
                        console.log('新增失败。。。')
                    }
                })
            }
        },
        goBack () {
            this.$router.push({
                name: 'bankinginfoindex'
            })
        },
        
    },
    mounted () {
        // this.uploadList = this.$refs.upload.fileList;
        // this.creditUploadList = this.$refs.upload.fileList;
    },
    created: function () {
        this.init()
    },
    activated: function () {
        //this.init()
    }
}
</script>
<style>
    .demo-upload-list-cover{
        display: none;
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(0,0,0,.6);
    }
    .card-upload:hover .demo-upload-list-cover{
        display: block;
    }
    .demo-upload-list-cover i{
        color: #fff;
        font-size: 20px;
        cursor: pointer;
        margin: 0 2px;
    }
    .demo-spin-icon-load{
        animation: ani-demo-spin 1s linear infinite;
    }
    @keyframes ani-demo-spin {
        from { transform: rotate(0deg);}
        50%  { transform: rotate(180deg);}
        to   { transform: rotate(360deg);}
    }
    .demo-spin-col{
        height: 100px;
        position: relative;
        border: 1px solid #eee;
    }
    .demo-upload-list{
        display: inline-block;
        width: 60px;
        height: 60px;
        text-align: center;
        line-height: 60px;
        border: 1px solid transparent;
        border-radius: 4px;
        overflow: hidden;
        background: #fff;
        position: relative;
        box-shadow: 0 1px 1px rgba(0,0,0,.2);
        margin-right: 4px;
    }
    .demo-upload-list img{
        width: 100%;
        height: 100%;
    }
    .demo-upload-list-cover{
        display: none;
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(0,0,0,.6);
    }
    .demo-upload-list:hover .demo-upload-list-cover{
        display: block;
    }
    .demo-upload-list-cover i{
        color: #fff;
        font-size: 20px;
        cursor: pointer;
        margin: 0 2px;
    }
</style>

